/* eslint-disable react/prop-types */
import useChannel from '@/pages/hooks/useChannel'
import { Select } from 'antd'
const { Option } = Select
export default function Channel (props) {
  console.log('channel组件的prop', props)

  const channelList = useChannel()
  return (
    // ...props 解构赋值 const (value,onChannel)=props
    <Select {...props} placeholder="请选择文章频道" allowClear style={{ width: 200 }}>
      {channelList.map((it) => (
        <Option key={it.id} value={it.id}>
          {it.name}
        </Option>
      ))}
    </Select>
  )
}
